// 均匀二维网格
#ifndef U2D_H
#define U2D_H

#include "dshSmoothU2d.h"
// #include "u2d.h"
#include "fdmU2d.h"
#include "diff2d.h"

using namespace std;

int main();

namespace u2dMesh{
    static double xMin,xMax,yMin,yMax;
    static int xNum,yNum;
    static double dx,dy;
    static double **xMat;
    static double **yMat;
    void readMesh(char *fileName);
}

namespace u2d{
    static diff2D::diffList lap;
    static diff2D::diffList diffFun;
    static double **b;
    static double **x0;
    static double **x1;
    int test();
    void init();
    void initMesh();
    void initLap();
    void calc();
    void genDiffFunction();
    int genEqu();
    int updateX0();
}

namespace u2dICBC{
    static int nMax;
    static double omegaX[100];
    static double omegaY[100];
    static double phiX[100];
    static double phiY[100];
    static double aX[100],aY[100];
    int readICBC();
    int readIC(char *fileName);
    int readBC(char *fileName);
}

namespace u2dFun{
    static double eps;
    static double **phi;
    int readEps(char *fileName);
    int readFun();
    int genBPts();
}

namespace u2dOut{
    int writeData(char *fileName,double **data);
}


#endif